//公共接口
import request from '../utils/request.js'


// 首页轮播图
export function getmatchLive(data,showOnload = true) {
  return request({
    url: '/api/auth/matchLive',
    method: 'get',
    showOnload,
    data
  })
}
// 申请赛事直播
export function postapplye(data,showOnload = true) {
  return request({
    url: '/api/auth/announcer/apply',
    method: 'POST',
    showOnload,
    data
  })
}
// 扫码进入赛事直播-查看申请情况 
export function getannouncer(matchId,showOnload = true) {
  return request({
    url: '/api/auth/announcer/'+matchId,
    method: 'POST',
    showOnload
  })
}
//直播员获取直播赛事列表
export function getmatchList(data,showOnload = true) {
  return request({
    url: '/api/auth/live/matchList',
    method: 'get',
    showOnload,
    data
  })
}


// 直播发送图文信息
export function liveSendMessage(liveId,data) {
  return request({
    url: '/api/auth/live/sendMessage/'+liveId,
    method: 'GET',
    data
  })
}
//修改资料
export function postedit(data,showOnload = true) {
  return request({
    url: '/api/auth/announcer/edit',
    method: 'POST',
    showOnload,
    data
  })
}
//获取赛事直播数量
export function hasLive(showOnload = true) {
  return request({
    url: '/api/auth/hasLive',
    method: 'get',
    showOnload,
  })
}
//获取以往直播消息列表
export function getMessagesList(matchId,data) {
  return request({
    url: `/api/auth/messages/${matchId}`,
    method: 'get',
    data
  })
}
module.exports = {
  getmatchLive,
  postapplye,
  getannouncer,
  getmatchList,
  liveSendMessage,
  postedit,
  hasLive,
  getMessagesList
}